from model import FormattedMessageCategory, FormattedMessage

category = FormattedMessageCategory()
print(category.get_all())
print(category.count({}))
try:
    category.add_one(name='test')
except Exception as e:
    print(e)
print(category.get_all())

msg = FormattedMessage()
try:
    msg.add_one(name='msg_test', text='msg_test', category='test')
except Exception as e:
    print(e)
print(msg.get_all())
msg.set({'name': 'msg_test'}, text='msg_test_update')
print(msg.get({'name': 'msg_test'}))
msg.delete({'name': 'msg_test'})
print(msg.get_all())
category.delete({'name': 'test'})

